package com.example.smarthomebluetoothclient;

import java.util.ArrayList;
import java.util.List;

import com.yadong.smarthome2.protocol2.ResultProtocol.DeviceInfo.DeviceType;
import com.yadong.smarthome2.protocol2.ResultProtocol.DeviceInfo.Status;
import com.yadong.smarthome2.protocol2.Utils;
import com.yadong.smarthome2.protocol2.client.DeviceInfoManager;
import com.yadong.smarthome2.protocol2.client.FunctionManager;

public class DeviceInfoManagerImpl extends DeviceInfoManager {
    private static final int CURRENT_DEVICE_INFO_VERSION = 1;

    public DeviceInfoManagerImpl(FunctionManager functionManager) {
        super(functionManager);
    }

    @Override
    protected DeviceType getDeviceType() {
        return DeviceType.APPLIANCE;
    }

    @Override
    protected String getDeviceDescription() {
        return "BT_TEST_APPLIANCE";
    }

    @Override
    protected List<Status> getStatusInfo() {
        List<Status> status = new ArrayList<Status>();
        Status.Builder statusBuilder = Status.newBuilder();
        status.add(Utils.createStatsu(statusBuilder, "light_is_on", "B"));
        status.add(Utils.createStatsu(statusBuilder, "color", "S"));
        status.add(Utils.createStatsu(statusBuilder, "hight", "I"));
        return status;
    }

    @Override
    protected int getCurrentDeviceInfoVersion() {
        return CURRENT_DEVICE_INFO_VERSION;
    }

}
